import request from '@/utils/request'

export function getPages(params) {
  return request({
    url: `/pages`,
    params
  })
}

export function getPagesCount(params) {
  return request({
    url: `/pages/count`,
    params
  })
}

export function delPage(id) {
  return request({
    url: `/pages/${id}`,
    method: 'delete'
  })
}

export function addPage(data) {
  return request({
    url: `/pages`,
    method: 'post',
    data
  })
}

export function getPageDetail(id) {
  return request({
    url: `/pages/${id}`
  })
}

export function updatePage(data) {
  return request({
    url: `/pages/${data.id}`,
    method: 'put',
    data
  })
}
